#pragma once
#include <functional>
#include <opencv2/opencv.hpp>
using namespace std;

struct AODInput {
  cv::Mat mat;
};
struct AODResult {
  cv::Rect rt;
  int type;
  int prop;
};

#ifdef ROS
#include <ros/ros.h>
#endif

typedef AODResult MsgAOD;

typedef function<void(MsgAOD &)> CallBack;

#include <memory>
using namespace std;
class AbandonObjectDetectPrivate;
class AbandonObjectDetect {
public:
  // callback为检测到事件时的回调函数
  AbandonObjectDetect(CallBack cb);

  ~AbandonObjectDetect();
  void detect(const AODInput &input);

  void setROI(cv::Rect rt);
  void setTimeThreshold(float fSec);
  void setAreaThreshold(int nSize);
  void setAreaThresholdMax(int nSize);
  // true: use simple Tactics(超过阈值即可) false: (需要查找合适的大小)
  void setTacticsFlag(bool bFlag);

  // must be even
  void setNeedToResetNumber(int nCount);

private:
  shared_ptr<AbandonObjectDetectPrivate> m_pHandle;
};
typedef shared_ptr<AbandonObjectDetect> AbandonObjectDetectPtr;
